package org.example;

import java.util.*;

/**
 * @className: test1
 * @author: 芃
 * @description:
 * @date: 2024/5/23 14:01
 */
class TreeNode {
  int val = 0;
   TreeNode left = null;
   TreeNode right = null;
   public TreeNode(int val) {
     this.val = val;
   }
}
public class test1 {
    public static List<String> topKFrequent(String[] words, int k) {
        StringBuffer[] str=new StringBuffer[words.length];
        for(int i=0;i<k;i++){
            int count=0;
            for(int j=i;j<words.length;j++){
                if(words[i].equals(words[j])){
                    count++;
                }
            }
            str[count]=new StringBuffer(words[i]);
        }
        ArrayList<String> s=new ArrayList<String>();
        int c=words.length;
        while(c-->0){
            if(str[c]!=null){
                s.add(str[c].toString());
            }
        }
        return s;
    }

    public static void main1(String[] args) {
        String[] str=new String[10];
        Scanner in=new Scanner(System.in);
        int k=in.nextInt();
        for(int i=0;i<10;i++){
            str[i]=in.next();
        }
        List<String> s1=topKFrequent(str,k);
        for(int i=0;i<k;i++){
            System.out.println(s1.get(i).toString());
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        scanner.close();
        HashSet<Character> hs = new HashSet<>();

        //write your code here......
        for(Character c:str.toCharArray()){
            hs.add(c);
        }

        for (char c:hs) {
            System.out.print(c);
        }
    }

    public ArrayList<ArrayList<Integer>> Print (TreeNode pRoot) {
        ArrayList<ArrayList<Integer>> lists = new ArrayList<>();
        if (pRoot == null){
            return lists;
        }
        Queue<TreeNode> queue = new LinkedList<>();
        queue.offer(pRoot);
        int flag = 1;//作为标志位，判断当前行是正序存储还是逆序存储
        while (!queue.isEmpty()){
            int size = queue.size();
            ArrayList<Integer> ret = new ArrayList<>();
            for (int j = 0; j < size; j++) {
                TreeNode cur = queue.poll();
                if (cur.left != null){
                    queue.offer(cur.left);
                }
                if (cur.right != null){
                    queue.offer(cur.right);
                }
                ret.add(cur.val);
            }
            if (flag == 1){
                //表示正序存储
                flag = 0;//标记为修改，下一行逆序存储
            }else{

                //表示逆序存储
                Collections.reverse(ret);
                flag = 1;//标记为修改，下一行正序存储
            }
            lists.add(ret);
        }
        return lists;
    }
}
